home *** CD-ROM | disk | FTP | other *** search
/ Foreland January 1997 / Foreland January 1997.iso / dicegame.dir / 00082_button Handler.ls < prev    next >
Encoding:
Text File  |  1996-12-26  |  667 b   |  24 lines

  1. on buttonClick
  2.   set spriteNum to the clickOn
  3.   set upNum to the memberNum of sprite spriteNum
  4.   set upName to the name of member upNum
  5.   set downName to upName && "hilite"
  6.   set downNum to the number of member downName
  7.   set the memberNum of sprite spriteNum to downNum
  8.   updateStage()
  9.   repeat while the mouseDown
  10.     if rollOver(spriteNum) then
  11.       set the memberNum of sprite spriteNum to downNum
  12.     else
  13.       set the memberNum of sprite spriteNum to upNum
  14.     end if
  15.     updateStage()
  16.   end repeat
  17.   if the memberNum of sprite spriteNum = downNum then
  18.     set the memberNum of sprite spriteNum to upNum
  19.     updateStage()
  20.     return 1
  21.   end if
  22.   return 0
  23. end
  24.